﻿using System;
using System.Collections.Generic;

namespace gbL.NetBoard.Broadcast
{
    public interface IBroadcaster
    {
        /// <summary>
        /// Event fires whenever a message is added to the blackboard
        /// </summary>
        event EventHandler<ChangedEventArgs> Added;
        /// <summary>
        /// Event fires whenever a message is removed from the blackboard
        /// </summary>
        event EventHandler<ChangedEventArgs> Removed;
        /// <summary>
        /// Raises the Removed event once for each item in removedEntries, 
        /// where the sender is the blackboard, 
        /// and a ChangedEventArgs contains the removed item
        /// <param name="blackboard">Becomes the sender of the event</param>
        /// <param name="removedEntries">Entries which have been removed</param>
        /// </summary>
        void NotifyRemoved(object blackboard, params IBlackboardEntry[] removedEntries);
        /// <summary>
        /// Raises the Added event
        /// where the sender is the blackboard,
        /// and a ChangedEventArgs contains the added item
        /// </summary>
        /// <param name="blackboard"></param>
        /// <param name="addedEntry"></param>
        void NotifyAdded(object blackboard, IBlackboardEntry addedEntry);
    }
}
